<?php
apf_require_class("APF_Component");
class Qa_HeaderComponent extends APF_Component {
    public function get_view() {
        $matches = APF::get_instance()->get_request()->get_router_matches();
        $current_nav = $matches[0];
        $current_nav = explode('/', $current_nav);
        $menulist = $_SESSION['menulist'];

        if(empty($current_nav)){
            $current_nav = Const_Qa::get_menu_list_en(Const_Qa::TAG_FINANCE);
        }
        $this->assign_data('current_nav', $current_nav[1]);
        $this->assign_data('menulist', $menulist);
        $this->assign_data('user_name', $_SESSION['user_name']);
        return 'Header';
    }

    public static function use_boundable_styles() {
        $path = apf_classname_to_path(__CLASS__);
        return array_merge(parent::use_boundable_styles(),array($path."Header.css"));
    }
}